package AST;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

public class Comparison {
	private List<Expr> exprList = new ArrayList<Expr>();
	private List<CompOp> compOpList = new ArrayList<CompOp>();

	public Comparison(List<Expr> exprList, List<CompOp> compOpList) {
		print();
		this.exprList = exprList;
		this.compOpList = compOpList;
	}

	public Comparison() {
		print();
	}

	public List<Expr> getExprList() {
		return exprList;
	}

	public void setExprList(List<Expr> exprList) {
		this.exprList = exprList;
	}

	public List<CompOp> getCompOpList() {
		return compOpList;
	}

	public void setCompOpList(List<CompOp> compOpList) {
		this.compOpList = compOpList;
	}

	public void addExprList(Expr e) {

		this.exprList.add(e);
	}

	public void addCompOp(CompOp op) {
		this.compOpList.add(op);
	}

	public void print() {
		System.out.println("Comparison");
	}

	public void genC(PW pw) {
		Iterator<Expr> itExpr = exprList.iterator();

		itExpr.next().genC(pw);
		for (CompOp op : compOpList) {
			op.genC(pw);
			itExpr.next().genC(pw);
		}

	}
}
